<?php
declare (strict_types = 1);

namespace app\v1\controller;

use app\model\Config;

class ConfigController
{
	function getCustomerService()
	{
		$data =[];
		$rows = Config::where(['group'=>'customer'])->select();
		foreach ($rows as $row) {
			$data[$row['name']] = $row['value'];
		}
		writeJson($data);
	}
	
	/**
	 * 用户协议
	 * @return void
	 */
	function getUserAgreement()
	{
		$row = Config::getFieldByName('user_agreement','value');
		writeJson($row);
	}
	
	/**
	 * 隐私政策
	 * @return void
	 */
	function getPrivacyPolicy()
	{
		$row = Config::getFieldByName('privacy_policy','value');
		writeJson($row);
	}
	
	/**
	 * 隐私政策
	 * @return void
	 */
	function getAbout()
	{
		$row = Config::getFieldByName('about','value');
		writeJson($row);
	}
}
